import React, { Component } from 'react'
import propTypes from 'prop-types'
export default class Son1 extends Component {
    constructor() {
        super()
        console.log('constructor')
    }
    static propTypes = {
        count: propTypes.number.isRequired,
        msg: propTypes.string.isRequired

    }
    static defaultProps = {
        count: 10,
        msg: ''

    }
    componentDidMount() {
        console.log('componentDidMount')
    }
    componentDidUpdate() {
        console.log('componentDidUpdate')
    }
    render() {
        console.log('render')
        return (
            <div>
                <h1>Son1组件</h1>
                <div>count:{this.props.count}</div>
                <div>msg:{this.props.msg}</div>
                <button onClick={() => { this.props.changeAge(60) }}>修改年龄</button>
            </div>
        )
    }
}
